home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Browsers, Managers & Extensions / CookieSwap 0.5 / cookieswap-0.5.0-fx.xpi / chrome / chromeFiles / content / ffComponents.js < prev    next >
Text File  |  2007-07-22  |  5KB  |  77 lines

  1. // *****************************************************************************
  2. // *                           ffComponents                                    *
  3. // * This file provides functions to get easy access to the Mozilla/Firefox(ff)*
  4. // * components (like nsICookieManager and nSICookieService)                   *
  5. // * Obviously these functions aren't doing much work they just help to        *
  6. // * keep the code looking cleaner in the other files.                         *
  7. // * Ideally these would be "C" Macros but I'm not sure how to do that         *
  8. // * in Javascript yet.                                                        *
  9. // *                                                                           *
  10. // ************************** Coding Standards *********************************
  11. // *  gMyVariable     - global variable (starts with "g", then mixed case)     *
  12. // *  myVariable      - variables passed into functions                        *
  13. // *  my_variable     - local variable inside of a function                    *
  14. // *  this.myVariable - class attributes/variable (mixed case & always         *
  15. // *                    referenced with "this.")                               *
  16. // *  MyFunction      - functions are always mixed case                        *
  17. // *  MY_CONSTANT     - constants are all caps with underscores                *
  18. // *                                                                           *
  19. // *************************** Revision History ********************************
  20. // *  Name       Date       BugzID  Action                                     *
  21. // *  ---------  ---------  -----   ------                                     *
  22. // *  SteveTine  2005Dec28  12561   Initial Creation                           *
  23. // *                                                                           *
  24. // ************************* BEGIN LICENSE BLOCK *******************************
  25. // * Version: MPL 1.1                                                          *
  26. // *                                                                           *
  27. // *The contents of this file are subject to the Mozilla Public License Version*
  28. // * 1.1 (the "License"); you may not use this file except in compliance with  *
  29. // * the License. You may obtain a copy of the License at                      *
  30. // * http://www.mozilla.org/MPL/                                               *
  31. // *                                                                           *
  32. // * Software distributed under the License is distributed on an "AS IS" basis,*
  33. // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License  *
  34. // * for the specific language governing rights and limitations under the      *
  35. // * License.                                                                  *
  36. // *                                                                           *
  37. // * The Original Code is the CookieSwap Mozilla/Firefox Extension             *
  38. // *                                                                           *
  39. // * The Initial Developer of the Original Code is                             *
  40. // * Steven Tine.                                                              *
  41. // * Portions created by the Initial Developer are Copyright (C) 2006          *
  42. // * the Initial Developer. All Rights Reserved.                               *
  43. // *                                                                           *
  44. // * Contributor(s): Steven Tine                                               *
  45. // *                                                                           *
  46. // **************************END LICENSE BLOCK**********************************
  47.  
  48. function ffGetCookieManager()
  49. {
  50.    return(Components.classes["@mozilla.org/cookiemanager;1"].
  51.                           getService(Components.interfaces.nsICookieManager));
  52. }
  53.  
  54. function ffGetCookieService()
  55. {
  56.    return(Components.classes["@mozilla.org/cookieService;1"].
  57.                                getService().QueryInterface(Components.interfaces.nsICookieService));
  58.  
  59. }
  60.  
  61. function ffGetStandardUrl()
  62. {
  63.    return(Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI));
  64. }
  65.  
  66. function ffGetDirectoryServiceProvider()
  67. {
  68.    return(Components.classes["@mozilla.org/file/directory_service;1"].createInstance(Components.interfaces.nsIDirectoryServiceProvider));
  69. }
  70.  
  71. function ffGetFileOutputStream()
  72. {
  73.    return(Components.classes["@mozilla.org/network/file-output-stream;1"].
  74.                               createInstance(Components.interfaces.nsIFileOutputStream));
  75. }
  76.  
  77.